/**
   http://oj.noi.cn/oj/#main/show/1003
 */
#include<stdio.h> 
int main()
{
	int x = 0;
	scanf("%d", &x);
	x = x * 1000 + x;
	x = x / 7;
	x = x / 11;
	x = x / 13;
	printf("%d", x);
	return 0;
}
